Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: decouple gateway status updates from the reconciler #4767

Merged
merged 27 commits into from
Dec 12, 2024

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Nov 22, 2024

Fixes: #4845
Release Note: Yes

@zhaohuabing zhaohuabing requested a review from a team as a code owner November 22, 2024 07:50
@zhaohuabing zhaohuabing changed the title decoup gateway status update fix: decoup gateway status update Nov 22, 2024
Signed-off-by: Huabing Zhao <[email protected]>
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 76.82927% with 19 lines in your changes missing coverage. Please review.

Project coverage is 66.31%. Comparing base (9b60a67) to head (fb00fb0).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
internal/provider/kubernetes/controller.go 57.14% 9 Missing ⚠️
internal/provider/kubernetes/status.go 71.42% 4 Missing and 2 partials ⚠️
internal/infrastructure/runner/runner.go 0.00% 2 Missing ⚠️
internal/provider/kubernetes/kubernetes.go 93.33% 0 Missing and 1 partial ⚠️
internal/provider/kubernetes/predicates.go 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4767      +/-   ##
==========================================
+ Coverage   66.24%   66.31%   +0.06%     
==========================================
  Files         209      209              
  Lines       31922    31950      +28     
==========================================
+ Hits        21148    21188      +40     
+ Misses       9523     9512      -11     
+ Partials     1251     1250       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhaohuabing zhaohuabing changed the title fix: decoup gateway status update fix: decoup gateway status updates from the reconciler Nov 22, 2024
@arkodg
Copy link
Contributor

arkodg commented Nov 22, 2024

were we deadlocking ?

@zhaohuabing
Copy link
Member Author

zhaohuabing commented Nov 23, 2024

were we deadlocking ?

It's my suspicion. I can't reproduce this issue, but based on the description of #4685, it seems that the reconciler has been blocked - the pods changes haven't been propogated to the Envoy through xDS, and the only PR in v1.1.3 that might cause blocking is #4337 .

Signed-off-by: Huabing Zhao <[email protected]>
@zhaohuabing zhaohuabing force-pushed the fix-gateway-status-blocking branch from 2b2535b to 8323c0f Compare November 23, 2024 07:20
Signed-off-by: Huabing Zhao <[email protected]>
@zhaohuabing zhaohuabing force-pushed the fix-gateway-status-blocking branch 2 times, most recently from 91fe885 to bb391aa Compare November 23, 2024 07:37
Signed-off-by: Huabing Zhao <[email protected]>
@zhaohuabing zhaohuabing force-pushed the fix-gateway-status-blocking branch from bb391aa to 7a4c51e Compare November 23, 2024 07:49
@zhaohuabing zhaohuabing marked this pull request as draft November 23, 2024 08:32
@zhaohuabing zhaohuabing force-pushed the fix-gateway-status-blocking branch from d948846 to 0a1f8f2 Compare November 23, 2024 11:47
Signed-off-by: Huabing Zhao <[email protected]>
@zhaohuabing zhaohuabing force-pushed the fix-gateway-status-blocking branch from 0a1f8f2 to e406088 Compare November 23, 2024 12:00
@zhaohuabing zhaohuabing marked this pull request as ready for review November 23, 2024 12:21
@zhaohuabing zhaohuabing requested a review from arkodg November 23, 2024 12:21
Signed-off-by: Huabing Zhao <[email protected]>
@arkodg arkodg changed the title fix: decoup gateway status updates from the reconciler fix: decouple gateway status updates from the reconciler Dec 11, 2024
zhaohuabing added a commit to zhaohuabing/gateway that referenced this pull request Dec 12, 2024
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
@zhaohuabing zhaohuabing requested a review from arkodg December 12, 2024 07:25
Signed-off-by: Huabing Zhao <[email protected]>
@@ -37,19 +38,22 @@ type Server struct {
// Logger is the logr implementation used by Envoy Gateway.
Logger logging.Logger
// Elected chan is used to signal what a leader is elected
Elected chan struct{}
Elected *sync.WaitGroup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need a pointer here?

Copy link
Member Author

@zhaohuabing zhaohuabing Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal/infrastructure/runner/runner.go:35:25: copylocks: literal copies lock value from *cfg: github.com/envoyproxy/gateway/internal/infrastructure/runner.Config contains github.com/envoyproxy/gateway/internal/envoygateway/config.Server contains sync.WaitGroup contains sync.noCopy (govet)
        return &Runner{Config: *cfg}

@zhaohuabing
Copy link
Member Author

Verified with #4904.

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team and guydc December 12, 2024 18:25
@arkodg arkodg merged commit c1ff135 into envoyproxy:main Dec 12, 2024
23 of 24 checks passed
zhaohuabing added a commit to zhaohuabing/gateway that referenced this pull request Dec 13, 2024
…4767)

* decoup gateway status update

Signed-off-by: Huabing Zhao <[email protected]>

* decoup gatewayclass status update

Signed-off-by: Huabing Zhao <[email protected]>

* fix test

Signed-off-by: Huabing Zhao <[email protected]>

* add comment

Signed-off-by: Huabing Zhao <[email protected]>

* fix test

Signed-off-by: Huabing Zhao <[email protected]>

* fix test

Signed-off-by: Huabing Zhao <[email protected]>

* revert gateway api runner

Signed-off-by: Huabing Zhao <[email protected]>

* update address and programming status

Signed-off-by: Huabing Zhao <[email protected]>

* Revert "update address and programming status"

This reverts commit bf3d07e.

* avoid overriding the gateway status from Gateway API translator

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* only subscribe to status updates upon acquiring leadership

Signed-off-by: Huabing Zhao <[email protected]>

* fix lint

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* address comment

Signed-off-by: Huabing Zhao <[email protected]>

* address comment

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* fix lint

Signed-off-by: Huabing Zhao <[email protected]>

* minor change

Signed-off-by: Huabing Zhao <[email protected]>

* release note

Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: Huabing Zhao <[email protected]>
(cherry picked from commit c1ff135)
Signed-off-by: Huabing Zhao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proxies connected to the secondary gateway do not receive configuration
4 participants